Skip to content

[pull] master from mozilla:master - #508

Merged
pull[bot] merged 6 commits into
code:masterfrom
mozilla:master
Aug 19, 2026
Merged

[pull] master from mozilla:master#508
pull[bot] merged 6 commits into
code:masterfrom
mozilla:master

Conversation

@pull

@pull pull Bot commented Aug 19, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

calixteman and others added 6 commits August 18, 2026 15:38
…g 1898053)

Some PDFs open a marked content section inside a text object and never
close it. Each section adds a nesting level in the text layer, so the DOM
becomes deep enough to crash Chromium with a stack overflow.

When extracting the text, the sections opened after the matching BT are
now closed on ET. The marked content level is tracked per stream in both
getTextContent and getOperatorList: the sections a stream left open are
closed when it ends, and an unbalanced EMC is ignored.
Auto-close the marked content sections left open in a text object (bug 1898053)
For JPEG images that can be decoded natively, always return an Object with a consistent shape regardless of the marker data.

Also, tweak a comment in `JpegImage.getTransferableImage` to avoid ambiguity.

Finally, replace `TextEncoder` usage with our `stringToBytes` helper in a unit-test.
Improve `JpegImage.canUseImageDecoder` return value consistency
This potentially avoids creating a lot of "duplicate" `TextDecoder` instances when parsing/rendering longer PDF documents.
For example, when rendering all 1310 pages of the `pdf.pdf` document (from the test-suite) this patch reduces the number of `TextDecoder` instances created by `stringToPDFString` from *over* `33 000` to just a single one.
…TextDecoder

Cache the `TextDecoder` instances used by the `stringToPDFString` helper
@pull pull Bot locked and limited conversation to collaborators Aug 19, 2026
@pull pull Bot added the ⤵️ pull label Aug 19, 2026
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot merged commit e051279 into code:master Aug 19, 2026
4 of 20 checks passed
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage August 19, 2026 14:03 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants